﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RayDen.Library.Components.SystemComponents;
using RayDen.Library.Entity.Frames;
using RayDen.Library.Entity.Interface;
using RayDen.RayEngine;
using RayDen.SceneLab.Core;

namespace RayDen.SceneLab.Controllers.Frame
{
    public class EngineConfigurationController
    {
        private IRenderConfig renderConfig;

        public EngineConfigurationController()
        {
            renderConfig = new RayEngineConfiguration();
        }

        public void Load(FrameDescription frame)
        {
            if (renderConfig == null)
            {
                renderConfig = new RayEngineConfiguration();
                Tracer.TraceLine("Render Config created");
            }

            renderConfig.OpenFrame(frame);
        }

        public void Unload()
        {
            renderConfig.Dispose();
            renderConfig = null;
            Tracer.TraceLine("Render Config disposed");
        }


        //public Command Init
        //{
        //    get
        //    {
        //        return new Command()
        //            {
        //                Name = "Init Render Config",
        //                Action = () =>
        //                    {
        //                        this.Load();
        //                    }
        //            };
        //    }
        //}
    }
}
